/*
 * Copyright (C) 2009 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.livewwallpaper.pongur;



import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.widget.LinearLayout;

import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;
import com.live.wallpaper.R;

public class PongUrSettings extends PreferenceActivity
    implements SharedPreferences.OnSharedPreferenceChangeListener{
    @Override
    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        
        setContentView(R.layout.all_settings);
    	// this is the best way I've found to disable the stupid transparent
    	// background
    	getListView().setBackgroundColor(Color.WHITE);
    	getListView().setCacheColorHint(Color.WHITE);
    	// Ads
    	final LinearLayout layout = (LinearLayout) findViewById(R.id.linearLayout);
    	final AdView adView = new AdView(this, AdSize.BANNER, "a14e6100232e8f0");
    	layout.addView(adView);
    	adView.loadAd(new AdRequest());
        getPreferenceManager().setSharedPreferencesName(
                PongUrPaint.SHARED_PREFS_NAME);
        addPreferencesFromResource(R.xml.settings_pongur);
        getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(
                this);
        
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onDestroy() {
        getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(
                this);
        super.onDestroy();
    }

    @Override
	public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
            String key) { 
    }

}
